from django.contrib.auth.models import AbstractUser
from django.db import models


# Create your models here.
class User(AbstractUser):
    """用户模型类"""
    name = models.CharField(max_length=150, default=None, null=True, blank=True, verbose_name='用户昵称')
    avatar = models.ImageField(upload_to='avater', null=True, blank=True, verbose_name='头像')
    mobile = models.CharField(max_length=11, unique=True, verbose_name='手机号')
    birthday = models.DateTimeField(null=True, blank=True, verbose_name="出生日期")
    money = models.DecimalField(max_digits=10, default=0.0, decimal_places=2, verbose_name="资金余额")

    class Meta:
        db_table = 'ly_users'
        verbose_name = '用户'
        verbose_name_plural = verbose_name
